Ext.define('passport.model.DepartmentModel', {
    extend: 'Ext.data.Model',
    requires: ['Ext.data.UuidGenerator'],
    idgen: 'uuid',
    fields: 
	    [
	     {name: 'Id',					type: 'string'}, 
	    	{name: 'ShortName', 	type: 'string'},
	    	{name: 'FactoryId', 		type: 'string'},
	    	{name: 'DeletedFlag', 		type: 'string', defaultValue: '0'},
	      {name: 'IsActive',					type: 'string', defaultValue: '0'},
	      {name: 'CreatedDate',					type: 'string'}, 
	    	{name: 'CreatedBy', 	type: 'string'},
	    	{name: 'LastModifiedDate', 		type: 'string'},
	    	{name: 'LastModifiedBy',					type: 'string'}, 
	    	{name: 'LastVisitedDate', 	type: 'string'},
	    	{name: 'LastVisitedBy', 		type: 'string'},
	    	{name: 'DeletedDate', 	type: 'string'},
	    	{name: 'DeletedBy', 		type: 'string'}
	    ],
	    validations: [
	  	{type: 'presence', field: 'ShortName'},
	  	{type: 'presence', field: 'FactoryId'}
	  ],
	  proxy: 
	  {
	  	type: 'ajax',
	  	url: 'http://192.168.1.116/RpcService/Gateway.ashx?module=organization&action=Department&method=save',
	  	api: 
        		{
        			destroy: 'http://192.168.1.116/RpcService/Gateway.ashx?module=organization&action=Department&method=delete'
        		}
	  	
	  },
	  idProperty: 'Id'
	    
});
